<template>
  <div class="tabbar">
      <van-tabbar v-model="tabIndex">
        <van-tabbar-item
          v-for="tabbar in tabbars"
          :key="tabbar.name"
          :to="tabbar.path"
          :icon="tabbar.meta.icon"
        >
          {{ tabbar.meta.title }}
        </van-tabbar-item>
      </van-tabbar>
  </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'Tabbar',
  data () {
    return {
      tabIndex: 0
    }
  },
  computed: {
    tabbars () {
      return routes.filter(route => route.meta.isTabbar)
    }
  }
}
</script>

<style lang="scss">

</style>
